<!DOCTYPE html>

<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
<meta charset="UTF-8"/>
<title>Insert title here</title>
</head>
<body>
	<div sec:authorize="hasRole('vip1')">
	<p>
	<a href="level1/1">1</a>
	</p>
	<p>
	<a href="level1/2">2</a>
	</p>
	<p>
	<a href="level1/3">3</a>
	</p>
	</div>
	------------------
	<div sec:authorize="hasRole('vip2')">
	<p>
	<a href="level2/4">4</a>
	</p>
	<p>
	<a href="level2/5">5</a>
	</p>
	<p>
	<a href="level2/6">6</a>
	</p>
	</div>
	------------------
	<div sec:authorize="hasRole('vip3')">
	
	<p>
	<a href="level3/7">7</a>
	</p>
	<p>
	<a href="level3/8">8</a>
	</p>
	<p>
	<a href="level3/9">9</a>
	</p>
	</div>
	==================
	
	<div sec:authorize="!isAuthenticated()">
		<p>
		<a href="login">登录</a>
		</p>
	</div>
	<div sec:authorize="isAuthenticated()">
		<span sec:authentication="name"></span>有的权限
		<span sec:authentication="principal.authorities"></span>
	
		<form action="logout" method="post">
		<input type="submit" value="注销" />
		</form>
	</div>
	
	
	
</body>
</html>